package com.javalong.affairs.manager;

import com.javalong.affairs.activity.UpdateMsgActivity;
import com.javalong.affairs.constant.BundleKey;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

public class IntentManager {

	public static void doActivity(Activity activity,
			Class<? extends Activity> cls) {
		activity.startActivity(new Intent(activity, cls));
	}

	public static void doActivity(Activity activity,
			Class<? extends Activity> cls, Bundle bundle) {
		Intent intent = new Intent(activity, cls);
		intent.putExtra(BundleKey.BUNDLE, bundle);
		activity.startActivity(intent);
	}

	public static void doActivity2(Activity activity,
			Class<? extends Activity> cls, Bundle bundle) {
		Intent intent = new Intent(activity, cls);
		intent.putExtras(bundle);
		activity.startActivity(intent);
	}

	public static void doActivityForResult(Activity activity,
			Class<? extends Activity> cls, int requestCode) {
		activity.startActivityForResult(new Intent(activity, cls), requestCode);
	}

	public static void doActivity(Context mContext,
			Class<? extends Activity> cls, Bundle bundle) {
		Intent intent = new Intent(mContext, cls);
		intent.putExtra(BundleKey.BUNDLE, bundle);
		mContext.startActivity(intent);
	}
}
